package com.meiyou.mapper;

import com.github.pagehelper.Page;
import com.meiyou.annotation.AutoFill;
import com.meiyou.entity.Report;
import com.meiyou.entity.Star;
import com.meiyou.enumeration.OperationType;
import com.meiyou.vo.ReportVo;
import org.apache.ibatis.annotations.Mapper;

/**
 * @BelongsProject: meiyou
 * @BelongsPackage: com.meiyou.mapper
 * @Author: 尹晓安
 * @Date: 2023/11/25 18:10
 * @Description: todo
 */
@Mapper
public interface ReportMapper {

    /**
     * 举报文章
     *
     * @param report
     * @return
     */

    @AutoFill(value = OperationType.INSERT)
    void insert(Report report);

    /**
     * 删除
     *
     * @param id
     */
    void delete(Long id);

    /**
     * 分页获取举报列表
     *
     * @return
     */
    Page<ReportVo> getReportPage();

    /**
     * 查询是否举报
     *
     * @param userId
     * @param articleId
     */
    Integer select(Long userId, Long articleId);

    /**
     * 根据文章id删除举报
     *
     * @param articleId 文章id
     */
    void removeByArticleId(Long articleId);
}
